import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/widgets/button/normal_button.dart';
import 'package:flutter/material.dart';

import 'default_bottom_sheet.dart';

/// ocr提示语
showOcrTipBottomSheet(BuildContext context, {VoidCallback onGotIt}) =>
    showDefaultBottomSheet(context,
        child: _OcrTipWidget(
          onGotIt: onGotIt,
        ),
        isScrollControlled: true,
        title: S.current.camera_modes);

class _OcrTipWidget extends StatelessWidget {
  final VoidCallback onGotIt;

  const _OcrTipWidget({Key key, this.onGotIt}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final titleStyle = TextStyle(
      color: aceBlueColor,
      fontSize: getSp(18),
      fontWeight: FontWeight.w700,
      height: 22 / 18,
    );
    final contentStyle = TextStyle(
      color: aceBlackColor,
      fontSize: getSp(14),
      fontWeight: FontWeight.w400,
      height: 22 / 14,
    );
    return Padding(
      padding: EdgeInsets.only(
        left: getDp(36),
        right: getDp(36),
      ),
      child: Column(
        mainAxisSize: MainAxisSize.min,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          SizedBox(
            height: getDp(20),
          ),
          Text(
            S.current.single,
            style: titleStyle,
          ),
          SizedBox(
            height: getDp(8),
          ),
          Text(
            S.current.capture_a_single_shot_of_your_receipt,
            style: contentStyle,
          ),
          SizedBox(
            height: getDp(16),
          ),
          Text(
            S.current.combine,
            style: titleStyle,
          ),
          SizedBox(
            height: getDp(8),
          ),
          Text(
            S.current.capture_multiple_sections_of_a_single_receipt,
            style: contentStyle,
          ),
          SizedBox(
            height: getDp(38),
          ),
          NormalButton(
            onTap: onGotIt,
            title: S.current.got_it,
          ),
        ],
      ),
    );
  }
}
